/* 主布局样式 */
.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* 顶部导航栏 */
.main-header {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo区域 */
.header-logo {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.header-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
}

.logo-image {
  height: 36px;
  margin-right: 8px;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
}

/* 导航链接 */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.nav-links li {
  margin: 0 15px;
  position: relative;
}

.nav-links li a {
  color: #666;
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 0;
  transition: color 0.2s;
  display: block;
}

.nav-links li a:hover {
  color: #ffd600;
}

.nav-links li.active a {
  color: #ffd600;
  font-weight: 500;
}

.nav-links li.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #ffd600;
  border-radius: 1.5px;
}

/* 用户区域 */
.user-section {
  position: relative;
}

.user-dropdown {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.user-info:hover {
  background-color: #f5f5f5;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  margin-top: 5px;
  z-index: 1000;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.user-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* 延迟消失效果 */
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* 当用户下拉和菜单本身都没有悬停时，延迟0.5秒后消失 */
.user-dropdown:not(:hover) .dropdown-menu:not(:hover) {
  transition: opacity 0.3s ease, visibility 0s linear 0.5s;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #444;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-item i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.dropdown-divider {
  height: 1px;
  background-color: #eee;
  margin: 8px 0;
}

.logout-item {
  color: #ff6b6b;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}

/* 图标样式 */
.icon-user:before {
  content: "👤";
}

.icon-key:before {
  content: "🔑";
}

.icon-invitation:before {
  content: "📧";
}

.icon-logout:before {
  content: "🚪";
}

/* 认证链接 */
.auth-links {
  display: flex;
  align-items: center;
}

.auth-btn {
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 10px;
}

.login-btn {
  color: #333;
  background-color: transparent;
  border: 1px solid #ddd;
}

.login-btn:hover {
  background-color: #f5f5f5;
}

.register-btn {
  color: #222;
  background-color: #ffd600;
  border: 1px solid #ffd600;
}

.register-btn:hover {
  background-color: #ffe066;
}

/* 主要内容区域 */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* 页脚 */
.main-footer {
  background-color: #333;
  color: #ddd;
  padding: 20px 0;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .main-header {
    padding: 0 16px;
    height: 56px;
  }
  
  .nav-links {
    display: none; /* 在移动端隐藏主导航 */
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  .main-content {
    padding: 16px;
  }
}